package cn.com.yitong.controller;

import cn.com.yitong.domain.User;
import cn.com.yitong.service.UserService;
import cn.com.yitong.utils.PageUtils;
import cn.hutool.core.lang.hash.Hash;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * @author Meng Shen
 * @date 2022/5/6
 **/
@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/userPage")
    public List<User> getUserPage(){
        PageUtils pageUtils = userService.queryPage(new HashMap<>());
        List<User> userList = (List<User>) pageUtils.getList();
        return userList;
    }

}
